package com.tul.exercise.base.string.format;

/**
 * @Description 《java编程思想》第13章 示例9：
 * <p>
 * String.format()使用
 **/
public class DatabaseException extends Exception{
    public DatabaseException(int transactionId, int queryId, String message) {
        super(String.format("(t%d, q%d) %s", transactionId, queryId, message));
    }

    public static void main(String[] args) {
        try {

            throw new DatabaseException(3, 7 , "write failed!");

        } catch (Exception e){
            System.out.println(e);
        }
    }
}
